import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
 {
  path:"/",
  redirect:"/login"
 },
 {
  path:"/login",
  name:"login",
  component:() => import("../views/Login")
 },
 {
   path:"/layout",
   name:"layout",
   component:()=>import("../views/Layout"),
   redirect:"/home",
   children:[
    {
      path:"/home",
      name:"home",
      meta:{
        mes:"首页"
      },
      component:()=>import("../views/Home")
    },
    {
      path:"/pms/product",
      name:"product",
      meta:{
        title:"商品",
        mes:"商品列表"
      },
      component:()=>import("../views/pms/product")
    },
    {
      path:"/pms/addProduct",
      name:"addProduct",
      meta:{
        title:"商品",
        mes:"添加商品"
      },
      component:()=>import("../views/pms/addProduct")
    },
    {
      path:"/pms/productCate",
      name:"productCate",
      meta:{
        title:"商品",
        mes:"商品分类"
      },
      component:()=>import("../views/pms/productCate")
    },
    {
      path:"/pms/productAttr",
      name:"productAttr",
      meta:{
        title:"商品",
        mes:"商品类型"
      },
      component:()=>import("../views/pms/productAttr")
    },
    {
      path:"/pms/brand",
      name:"brand",
      meta:{
        title:"商品",
        mes:"品牌管理"
      },
      component:()=>import("../views/pms/brand")
    }
    

   ]
 }


]

const router = new VueRouter({
  routes
})

export default router
